<template>
  <div class="opinion">
    <div class="content">
        <div class="title">请告诉我您的意见和想法</div>
        <div class="text">
            <textarea class="textarea" name="" id="" placeholder="快来写下意见吧" placeholder-style="color:#999;font-size:24rpx"></textarea>
        </div>
        <div class="upload" @click="upload">
          <image src="/static/images/plus.png" alt=""/>
        </div> 
        <div class="footer" @click="complit">提交</div>
    </div>
  </div>
</template>

<script>

export default {
  data () {
    return {

    }
  },
  methods: {
      upload(){
        wx.chooseImage({
          count: 1,
          sizeType: ['original', 'compressed'],
          sourceType: ['album', 'camera'],
          success (res) {
            // tempFilePath可以作为img标签的src属性显示图片
            const tempFilePaths = res.tempFilePaths
          }
        })
      },
      complit(){
        wx.showToast({
            title: '提交成功',
            icon: 'success',
            duration:1000,
            success:function(){
              setTimeout(() => {
                wx.switchTab({ 
                  url: '/pages/my/main'
                })
                
              }, 1000);    
            }
        });
      }
  },

  created () {
    // let app = getApp()
  }
}
</script>

<style scoped lang="less">
  .opinion{
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    position: absolute;
    .content{
      width: 100%;
      padding: 0 28rpx;
      box-sizing: border-box;
      font-size:26rpx;
      color:#333;
      position: relative;
      .title{
        margin: 14rpx 0 28rpx 0;
      }
      .text{
        width: 100%;
        height: 436rpx;
        background: #fff;
        padding: 14rpx 0 0 20rpx;
        box-sizing: border-box; 
        .textarea{
          height: 200rpx;
        }    
      }
      .upload{
          width: 152rpx;
          height: 152rpx;
          border:2rpx dashed #666;
          display: flex;
          align-items: center;
          justify-content: center;
          position: absolute;
          top: 320rpx;
          left: 60rpx;
          image{
            width: 80rpx;
            height: 80rpx;         
          }
      }
      .footer{
          width:656rpx;
          height:80rpx;
          background:rgba(255,61,79,1);
          border-radius:40rpx;
          line-height: 80rpx;
          text-align: center;
          color: #fff;
          font-size: 30rpx;
          margin-top: 40rpx;
          margin-left: 20rpx;
      }
    }
  }
 
</style>
